#include<iostream>
#include<thread>
#include<unistd.h>
using namespace std;

void func(const int &a)
{
    cout<<"&a       = "<<hex<<&a<<endl;
    cout<<"a        = "<<dec<<a<<endl;

    return;
}

int main()
{
    int tempintA = 888;
    int &tempintB = tempintA;
    cout<<"&tempintA= "<<hex<<&tempintA<<endl;
    cout<<"&tempintB= "<<hex<<&tempintB<<endl;
    thread thOne(func, tempintB);
    thOne.detach();
    sleep(1); // 此处为了让主线程睡一秒，来让子线程的打印地址能够打印出来
    cout<<"main out"<<endl;

    return 0;
}